<template>
  <div>
    <el-form :model="formData" label-width="80px">
    <el-form-item label="项目名称">
      <el-input v-model="formData.projectName"></el-input>
    </el-form-item>
    <el-form-item label="项目描述">
      <el-input type="textarea" v-model="formData.projectDescription"></el-input>
    </el-form-item>
    {{ isEdit }}
  </el-form>
  </div>

</template>

<script>
export default {

  props: {

    isEdit: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      formData: {
        projectName: '',
        projectDescription: ''
      }
    };
  },
  methods: {
    submitForm() {
      // 这里可以添加表单提交的逻辑，例如发送请求到后端
      console.log('表单数据:', this.formData);
    },
    resetForm() {
      this.formData = {
        projectName: '',
        projectDescription: ''
      };
    }
  },

  created() {
    console.log(this.data)
    if (this.isEdit) {
      // 如果是编辑模式，从后端获取项目信息并赋值给表单数据
      // ...
    }
  }
};
</script>

<style scoped>

</style>
